package com.fruit.utils;

import java.util.List;


import com.fruit.service.IDeliveryService;
import com.fruit.web.bo.impl.Delivery;
import com.fruit.web.constant.ManageBeanConstants;
import com.fruit.web.constant.SpringBeanConstants;
import com.fruit.web.vo.common.LocalBean;


public final class DeliveryUtil {
	public DeliveryUtil() {
	  }
	public static List<Delivery> getDeliveries() {
		IDeliveryService deliveryService = (IDeliveryService)SpringFacesUtil.getManagedBean(SpringBeanConstants.DELIVERY_SERVICE_BEAN_NAME);
		deliveryService.setEntityClass(Delivery.class);
		deliveryService.setPKClass(Long.class);
		LocalBean localBean = (LocalBean)SpringFacesUtil.getManagedBean(ManageBeanConstants.LOCAL_BEAN);
		List<Delivery> deliveries = deliveryService.findBy("deliveryLocale", localBean.getLocale());
		return deliveries;
	}

}
